package com.ljc.dao;

import com.ljc.entity.DevicePurchasePlanning;
import com.ljc.vo.AssignExpert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface ProjectPlanningArgumentDao {

    void add(List<AssignExpert> assignExperts);

    @Update("update project_planning_argument set status=#{status} " +
            "where project_planning_id=#{id} and expert_id=#{expertId}")
    void setStatus(@Param("id") int id,@Param("expertId") int expertId,@Param("status") int status);

    @Select("select count(*) \n" +
            "from project_planning_argument\n" +
            "where project_planning_id=#{projectId} and status=1")
    int countUnArgument(int projectId);
}
